﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.Windows.Forms;
using HotelManagement._04.OBJECT;

namespace HotelManagement._03.DAO
{
    class ReportBookingInfoDAO
    {
        DbConnection m_conn;
        SqlCommand m_command;
        SqlDataAdapter m_adap;

        public ReportBookingInfoDAO()
        {
            m_conn = new DbConnection();
        }
        public DataTable ViewReportBookingInfo(DateTime ip_FromDate, DateTime ip_ToDate, string ip_procedure)
        {
            m_command = new SqlCommand(ip_procedure, m_conn.Connect());
            m_command.CommandType = CommandType.StoredProcedure;
            m_command.Parameters.Add("@FromDate", SqlDbType.DateTime).Value = ip_FromDate;
            m_command.Parameters.Add("@ToDate", SqlDbType.DateTime).Value = ip_ToDate;
            DataTable v_dt = new DataTable();
            m_adap = new SqlDataAdapter(m_command);
            try
            {
                m_adap.Fill(v_dt);
                m_conn.Close();
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.ToString());
            }
            return v_dt;

        }

    }
}
